<script src="../asynx.js"></script>
<script src="../dom/dom.js"></script>
<script src="../impl/array.js"></script>
<script src="../impl/util.js"></script>
<script src="../impl/cookie.js"></script>
<script src="../impl/ajax.js"></script>
<script src="../impl/lang.js"></script>
<script src="../dom/xpath.js"></script>
<script src="../dom/selector.js"></script>
<script src="../event/event.js"></script>

<script src="../plugins/drag/drag.js"></script>
<script src="../plugins/animation/anim.js"></script>
<script src="../plugins/datalist/datalist.js"></script>


<h1>asynx ajax upload (iframe)</h1>
<div id="log" class="a">Log<br></div>

<form name="testeFm1">
	
	<input type="text" name="form1" value="aaaaaaaaaa">
	<input type="file" name="aaaa" >
</form>

<form name="testeFm2" action="submit1.php">
	
	<input type="text" name="form2" value="aaaaaaaaaa">
	
</form>

<form name="testeFm3">
	
	<input type="text" name="form3" value="aaaaaaaaaa">
	
</form>

<button id="teste">Enviar</button>

<script>

	
	
	asynx('teste').click(function() {
	
		
		
		
		/*asynx.$submit('//form[2]', "submit.php", { teste:"ddddddd" }, function(r) {
			log("OK!" + r)
		});*/
		
		
		asynx.ajax.SYNC_AJAX_SUBMIT = false;
		
		var ajax = new asynx.ajax({
			
			//url: 'submit.php',
			
			url: 'submit.php',
			
			onComplete: function(r) {
				alert("primeiro: " + r)
			},
			
			loading: function(s, a) {
				log(s + ":" + a)
			},
			
			loadingArgs: "primeiro"
			
		});
		
		ajax.submit(document.testeFm1);
		ajax.load();
		
		
		var ajax1 = new asynx.ajax({
			
			url: 'submit1.php',
			
			onComplete: function(r) {
				alert("segundo: " + r)
			},
			
			loading: function(s, a) {
				log(s + ":" + a)
			},
			
			loadingArgs: "seg"
			
		});
		
		ajax1.submit(document.testeFm2);
		ajax1.load();
		/*
		
		var ajax2 = new asynx.ajax({
			
			url: 'submit1.php',
			
			onComplete: function(r) {
				alert("terceiro: " + r)
			},
			
			loading: function(s, a) {
				log(s + ":" + a)
			},
			
			loadingArgs: "ter"
			
		});
		
		ajax2.submit(document.testeFm3);
		ajax2.load();
		*/
		
	});
	
	

	
</script>